#!/usr/bin/perl -w
# 
# Task C (4 points)
#Write a program that defines an array containing five DNA sequences. The program 
#should also ask the user for two numbers and store them in variables. Subsequently, 
#use a for-loop to iterate from the first to the last element in the array. Inside the 
#loop, check if the loop variable is between the numbers given by the user. 
#For example, if 1 and 4 are given by the user, the condition is true when the loop 
#variable is 2 and 3. When the condition is true, the program should index the array 
#and print the corresponding elements, in this case sequence 2 and 3.
#
#
#
#Define an array of five DNA sequences
@DNAseqs = ("CGTATCATCT","CGTAGC","CGATCTGCATGC", 
"CGTACGTATCATCTGCATGCTCATCTGCATGC","GCATGC");
 
#Get the interval from the user
print "Please give two numbers \n";
$lo = <STDIN>;
$hi = <STDIN>;


#Loop through the array

 for ($i=0; $i<= $#DNAseqs; $i++){
    if($i>$lo && $i<$hi){
        print ("The DNA sequence at index $i is $DNAseqs[$i]\n");
    }
 }